intermediate code for weekend update
added factory pattern, need to split out views and add comments/documentation