some somewhat major refactoring, also modified parser to parse new controller types.