may convert to rails in next commit