Refined include guards and removed legacy code