refactor structure of solution