Reduce setq expression
Separate functions for readability
Use 'when' instead of 'if' if there is no else clause
Merge pull request #13 from kyagi/refactoring

Refactoring