Move registry stuff to extra module