minor fix and restructure