Use BigInteger, better locking, entities