Refactized getting code metrics