geometry and light pass works

done some cleaning and refactoring