[Bug 923646] (Refactored, not squash just for reviewing)