Updated code to make it more homogeneous