Refactor, minimal changes to 3d view