new pattern for compile method