Added configs and some code cleanup