refactor to use a shake handler