Restructure to make it easier to extend in the future

Reviewed by:	will
Suggested by:	ngie