Removed some duplicated code.
Remove dupe code.