Added unit test and some internal generator simple logic