Refactor controller instantiation for flexibility.