Major refactoring. All functions with no return value is now void. Returnable objects are generic type.