Added a couple configuration options, more code cleaning