tests ready and refactoring done