Some little refactoring
Refactored frame loading