Required bug fixed. Refactor.