Frontend js cleanup, files refactoring