Simplify functions and structures.

Remove unnecessary parameters in functions and add bool attributes to
structures for faster and cleaner status checking. Remove pointers and
add global structures.