Modify the code structure of usage calculation