more refactoring - next job add tests