more clean up based on dcsobral's suggestions