refactoring: readBitmap