Use the byType variable correctly and keep it in this.by for extensibility.
merge with fix