Removed a bit of duplicate code