Adding frame limiter
Refactoring