Revert "Refactor code."

This reverts commit 2e36b8f262d57f45ab446dcde5da7945f22f204a.