started refactoring plexlib for better performance and code usability