Beginning refactoring for better bitmap loading