reverting revisions 1409492, 1409854, 1409887, 1409928, 1409937 to reorganize changes and apply the refactoring proposed in all related branches