Librato refactor