in the process of refactoring basis.jl