Simplified code.

Code simplified to remove unnecessary steps.