refactor
collapsing true/false ifl