No global cluttering and minor optimizations
Type checking functions moved to individual files