Issue #174: got rid of internal Layer class