RWC: Code cleanup and pin changes