little design changes and code clean up