code simplification

This closes #13