LPS-48231 Move logic from jsps to the backend