refactorig controllers and modles
fixing some conflicts