Refactor of road calculator