Adding logic to perform actions