cleanup & port to pyramid 1.5