refactoring of the application code and layout. added private methods for post and topic controllers to resuse code for params