Source code refactoring . Merged functionalities euclidean_cost and chebyshev_cost