Revert "Using Integer instead of BigInteger for less memory consumption"

This reverts commit 5e45baf44d377d4d8142026ac25c84ebf2d713db.