TODO: 100% test coverage