code cleanup, init order tweak