moving code around to prep for web ui