Added active expiration. Simplified code. TODO: Benchmark expiration