improve the quality of the code

improve the the quality of the code for the implemented metrics