A few changes in preparation to add extension support