Hintify the code
DRY refactoring