move boostrap to function