refactored controller base