refactored
removed unused import
added tests