move code to javarosa plugin