Refactored the code and exported it as a .jar file