Changed some code according to the code inspection