improve and or functions