Major rewrite initial commit