working on refactoring, adding deconnection method, adding decrypt metohd too