fixed a few code smells