better way to manage window positions