speedup and cleanup. possible fun extensions.