code reorganization and implementation of MVP pattern (possible multi
window)