Fixed some code smells.