Clean up ardent handling. Add tests