BIG refactoring, PTa's code removed