Refactoring & improvements.