refinement: extract more methods.