Towards Better Correctness and Efficiency in Code Generation