Formated code
Added config support