Handles all the operations