more refactoring: saving detected stops to db