Cleanup
Move rep generation to class method
Add background methods and caching support