refactor to prevent accesses to 'speed'