split out functionality into functions
moved actions into new file, sketched out actions' logic as comments