Updated after code review on 3rd Oct 2014