Refactored code. But texture shader is still not working