project refactor
better exception handling