-- add cache support and code cleaning