Refactors main class to take storage instances