RF: start refactor of logan, adding tests