This block of code could be moved a to separate util function, like ``parse_size``