some more project restructuring and code cleaning