Code cleanup and dependency updates