[refac] moved the layer state return type to the other file