Fix bug and refator language