added version generator and some reorganization