refactor how bandwidth is calculated