Improve state functions to store less data