Refines configuration, adds working code