refactored get() method