export functions inlined. TODO context