Code refactoring for votes and comments