Major rewrite and orginization