Some code refactoring.
Added frames data changing.