Refactored 3dworld into several files