Implement rectify() method that additionally clean up markup