Moving everything into rails architecture