added test
refactoring