refactoring entries controller