move random from database to application