refactor / reformat to fix code smells