Cleanup based on @marcoscaceres's suggestions