refactor main - delete works