added application controller
extracted methods from user class into a parent class