cleanup and refactoring

Paths are now separately stored in arrays.