add some thought for refractoring