refactoring - partial