better exception handling + design changes