optimized a shit ton of stuff in bootstrap function