deleted attempts at JS refactor