Add comments and cleanup component code