reformat code and update layouts.