started working on a state thing to reduce redundant calls