Adding tests, refactoring service path filtering