refactoring of convolutional networks