made code structure a little more consistent.