Code documentation + cleanup