refactor moving templateTests/widgets

Close #529