move logic to directive controller
update README to reflect changes