finish UI, refactor structure