Rearrange commands to chain actions