refractoring controller more
refractor controller by creating a user varialbe insted of having two user varialbes