Moved geometry stuff to separate files