more refactoring from solutions