rewrite to use action composition