Moved .aiw code into it's own module