boilerplate optimized and apply chaning