Clearned up code