tweaks and removing old code