try to reduce repeated work