Reduced code size by creating an enum powered function