refactoring
fixed test