Code cleanup & simplification