Fix typo
Refactor a bit