some more core restructuring, improvements and cleaning