refactored so smarty is a function call, and improved file name to line
up with convention