Code cleanup & commenting