Code cleanup & work in progress