Removed a partially duplicated function