SOme refactorizing.