refactor to work in cloud9 ide