merge all the commands into singular layers