initial refactor for  controllers