various fixed and cleanup