Removed a little duplicated code.