code refactoring, added base controllers