Slight refactoring to get rid of unnecessary factory class, removed
excess changes