Even more changes and cleanup (still not working)