refactored test code from src folder to test folder