Refactored startup process.