clean code and remove warnings