apart test done. more refactoring