refactor and implement multi texture support