moved to single file, other small tweaks