remove unused library
add throw exception
make connection as final