Replaced currentComponent instance variable with a local one.
Minor refactoring.