Better commenting and cleanup