Moved out transaction processing
Refactored entity manager