move more functions to generic