Refactored - Dont know if tested