Improve and generalize frame attribute handling