refactored startup.