result set problem solved, some refactoring
tiny refactorings