Polish the layer 1 and fix some bugs