some code and design changes