refactored get method to be able to reduce complexity