Remove static method calls, add basic exception handling