MAINT reduce amount of boiler code using standard C operations