ui & code cleanup, added table sort