refactored shader code