Switched to logger for server output
Cleaned up some code.