rework rtl functions for auto generation from source