Rework some bootstrapping process.

Signed-off-by: crynobone <crynobone@gmail.com>