serious restructuring of code, can't do without it