refactored structure and bootstrap implementation