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