refactored commands and events

into their own files.