Refactored loading config

Closed #23