Closed #1 and closed #3 in previous commits