moved geometry and dispatch code to separate files
removed geometry and dispatch code from the main source file
updated tests