Refactored fragment shader