Added forward declarations wherever possible