moved the side logic to it's own files.