Cleaning up #40 implementation