xwen: cleanup/add/refactor in maultiple places. Most of these need to be added in later(temporaryly stored here on this branch)