refactoring of the main application architecture