Refactored source to remove extraneous imports and variables.