Refactor a bit
Add integration test for master maintenance flows
Merge branch 'yanoh-add_test-master_maintenance_flows' into develop