refactor of solution improvement