[WIP] code cleanup