Ack. Refactored as per suggestion