Removed Marshal dependency, compute everything on SQL