Refactor and remove whitespace