added test for smarty widget, refactored smarty widget