JS front refactored