Code cleanup on skills queries