Combine some steps to reduce the number of layers