Extract a helper function from `_build_bases`
Extract a helper function from `_build_bases`

This reduces the indentation level by a bunch, which should hopefully make the codebeat CI tool happier

arsenovic/galgebra,arsenovic/galgebra