refactoring thanks to flycheck