another initial refactoring