Major code refactoring (still incomplete)