[src] minor tweaks and refactoring.