refactored get method