Improved Edge Code

I added more design pattern stuff into the program so that it would be
easier to implement changes in the future.