making the main program useful, +inline method
Extracted a class library from the console app and fixed references