Refactoring everything a bit.