Max Distance logic

- Added logic to change the max-distance
- Added switch to use mock location
- some more code cleanup

Signed-off-by: Satbir Jhuti <satbirjhuti@gmail.com>