hack regarding prefix removal. Leave this alone now, it needs to be rewritten.