Refactoring for pixel classes