remove duplicate logic