made interrupt functions as short as possible