refine UI, continue to make code more modular