refactoring: moved all common functions to a new file common.py