improve method: apply and its sub-method