Refactoring select method