more coherent layout for common code