Helper methods for UIKit and Core Graphics