refactore for better usablility