Repo cleanup

Also some code cleanup