* change method to return Optionals * add check for empty Optional * replace ifPresent() with get() * remove extra check