Adds more checks to avoid expensive operations and renames methods.