A litte more refactored