Commit after test completed and minor refactoring