forward declarations and some chopping