Some nice refactoting