simplifying feach, removing getIfType function