added implement to singletons, moved gui handler to external js