This Paper deals with the optimum energy management of Microgrid (MG) having Energy-Storage System(ESS)s. Recently, the importance of retaining the profits of MG owners and the needs of providing additional requirements to the electric grid are rising. To accommodate these needs systematically, the Quadratic Programming (QP), one of the simplest and effective optimization method, is gaining attention. The QP has been used for similar cases before, but unlike the known advantages of early QP studies, some of the subsequent papers have been conducted in an inappropriate direction and may be overshadowed. Therefore in this paper, an extended and more practical QP cost function considering the realistic operating conditions is proposed, and the advantages of the original methods are revisited with comparisons. As a result, the proposed method retains the genuine features of QP, such as peak power shaving and assuring the power reserve rate, and can be simply extended to include Electric Vehicle (EV)s into the optimization. Additionally, the practical issues of implementing the QP in real-time have been discussed and resulted in both improved optimization speed by 58% using the cost function reformulation and the robustness with the forecast mismatching.