major design refactor