code cleanup and optimizations, fix opening when dragging but not changing position or working set