Refactored the Bitmap class