refactoring the code and add database access layer, update the ui,xml parser etc.