main
code decomposition and refactoring
code refactoring and updates
added tests, alembic, refactoring