Refactoring and trying to get better score