States machines for basic functionalities