reformatted refactored code
fixed incorrect method name breaking tests