Config support added
Refactored