[build][refac] upgraded build system and layers implementation so it works with previously written layers