Code review on code extraction PR

See commit messages for detailed informations on what changed.