Split shader code out into class