Code cleanup
Rework command handling & improve set config handling