controller code refactoring and commenting