tweaks and remove unused code