Code cleanup for slackpatch