layer creation modularized