some work for nicer rails integration