Clean up whitespace and naming of functions