refactoring so that we can use the designer code directly without modifications