Code cleanup (more script friendly) + ID checkers