Updated with code cleanup, slightly enhanced security and filters.