some architectural refactorings has been made.