Renamed most functions for consistency and simplicity.