Refactoring various areas