moved handlers inside actions