Pulled out more interface code to external files