Refactoring after PL's initial review