added test + refactored