Refactor repeated shader setup code