refactor tests and all_paths.rb