Make config a bit easier to change and cleanup some loops