Refactor and splitting of geometry and rendering