Continued implementation of input-only tests + some refactoring.