add escape + refactor