change the way to implement layer