Refactoring parameter retrieval in controllers