Adds a Board class and cleans up code