Moved functionality out of console app to a library assembly