Made compliant with style guide & changed to closure