Moved copypasta code to its own namespace.