Making server more configurable and small cleanups