shaped up code according to style guide.