refactor scripts and test homeController