refactor events and commands for clarity