Code clean up

Cleaned up code and config