Starting to clean the code and continue adding stream support