refoctoring controller