Port setup and mapping over from existing code