Refactoring. Thanks @Zearin