more correct removal of before/after

Based on this info: http://stackoverflow.com/a/3012769/171237