cleanup
Resolution handling rewritten