refactor get method