Minor improvements
Splitted the code into multiple files
Transaction support