Refactoring: Removed unnecessary variables and checks.