Code has been refactorized.