Code cleanup & extra features