a little bit of cleanup, need some advice on structure