Work in progress: error-throwing changes while trying to optimize performance