Cleaning code, adding abstraction functions.