added a test, extracted a method, introduced descriptive local variable