move more functions to generic code