fixed some code smells