moved from https://code.google.com/p/kay-framework/