Refactoring in order to be able to add refraction and reflexion.