Massive rewrite - the beginning