Fixed some code smell