add a bit on configuration, and reorder some operations