refactored boostrap