big refactor of solution.