Minor optimazitions