refactor based on chat with Librato devs