Refactored test code into separate binary