custom speed metrics, refactoring, fixes