perf(WTF): extracted scopes to separate file, add documentation

Closes #1361