Select data refactoring