Create transaction model and some few optimizations