some small code design changes