Optimizations

Make specialized functions with specific constants embedded in them,
instead of being passed as an argument in generic form.