refactored changes applied to test