Refractored attach_shader to attach to remove redundancy