Tweaking code structure