refactored and commented panel mixin