enough tests now, time for refactoring...