work-in-progress refactoring of the aparapi functions