Refactored local metric calculations out. #64