Updated to make code more clean.