refactored .trim() on base64 to method