Global refactoring & documenting