migrated all entry_count logic from view to controller
Merge branch 'refactor_entry_count'

Obviously the refactoring View -> Controller worked.