optimization/visual fixes

Condensed code + fixed small visual bugs