Refactor Solution