better exception handling and interfacing