Refactoring getById